﻿using FluentNHibernate.Mapping;
using Romantics.Domain.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Romantics.Domain.Mappings
{
    class PhotoAlbumSummaryMap : ClassMap<PhotoAlbumSummary>
    {
        public PhotoAlbumSummaryMap()
        {
            Table("ALBUM_SUMMARY");

            Id(x => x.ID);

            Map(x => x.Name)
                .Length(200)
                .Not.Nullable();

            Map(x => x.Meta)
                .CustomType("StringClob")
                .CustomSqlType("NVARCHAR(MAX)");

            Map(x => x.Description)
                .CustomType("StringClob")
                .CustomSqlType("NVARCHAR(MAX)");

            Map(x => x.Links)
               .CustomType("StringClob")
               .CustomSqlType("NVARCHAR(MAX)");

            Map(x => x.Published)
                .Column("PUBLISHED")
                .Not.Nullable();

            References(x => x.Hike)
                .Column("HIKE_ID")
                .Not.Nullable();
        }
    }
}
